home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_funicular.cog < prev    next >
Text File  |  1999-11-15  |  25KB  |  881 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_Funicular.cog
  4. #
  5. # This cog will play the funicular puzzle area in Vol.
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. #.......................MESSAGES....................
  15. message    startup
  16. message    activated
  17. message    entered
  18. message    exited
  19. message    aievent
  20. message    pulse
  21. message    arrived
  22.  
  23. #.......................ACTORS....................
  24. thing    player                                                    local
  25. thing    indyActor
  26. thing    indyInTram
  27.  
  28. #.......................ACTOR LOOK TARGETS....................
  29. thing    in_endlook
  30.  
  31.  
  32. #.......................PROPS....................
  33. thing    funicular                                                
  34. thing    pivotrack
  35. thing    realpivotghost
  36. thing    crate                                                    
  37. thing    switch
  38. thing    fixtarget
  39.  
  40. thing    switchhitplate
  41.  
  42.  
  43. #.......................CAMERA TARGETS....................
  44. thing    indyActortarget                                                local
  45.  
  46. # first set of camtargets
  47. thing    fixfailcamtarg
  48. thing    fixcamtarg
  49. thing    showCamtarg
  50. thing    lavacrosstarg
  51. thing    blastwalltarg
  52. thing    endscenetarg
  53. thing    switchshottarg
  54. thing    fixendcampos
  55.  
  56. # second set of camtargets
  57. thing    rollawaytarg    # cam offsets to this positions
  58. thing    zoom1targ            
  59. thing    zoom2targ            
  60. thing    templetarget
  61.  
  62.  
  63. #.......................ACTOR MV_TARGETS....................
  64. thing    commietarget
  65. thing    commietarget2
  66. thing    commietarget3
  67. thing    commietarget4
  68. thing    commietarget5
  69.  
  70. thing    commie                                                    local
  71. thing    goalThing                                                local
  72. thing    in_mv0
  73. thing    in_fixmv
  74. thing    in_endscenemv
  75.  
  76. thing    lastfirepos0                                            # final commie blasting position
  77. thing    lastfirepos1                                            # final commie blasting position
  78. thing    lastfirepos2                                            # final commie blasting position
  79. thing    lastfirepos3                                            # final commie blasting position
  80.  
  81. #.......................EVENT LOCATIONS....................
  82. thing    blastpos
  83. thing    thepiece                                                local
  84. thing    commiespot_targ                                    
  85. thing    commiecreate_spot                                    
  86. thing    endfire_target1            
  87. thing    endfire_target2            
  88.  
  89. #.......................CAMERAS....................
  90. thing    curCam                                                    local
  91.  
  92. # first set of cams
  93. thing    fixfailcam                                                # cam for failed repair attempt
  94. thing    showCam                                                    # camera for indyActor's "Volodnikov..." line
  95. thing    fixCam                                                  # camera for indyActor's fix it position
  96. thing    panCam                                                  # camera pans to cruciform
  97. thing    blastwallcam                                            # camera to show commies' entry
  98. thing    endscenecam                                                # to return player control
  99.  
  100. # second set of cams
  101. thing    rollCam                                                  # camera for first zoom shot
  102. thing    butCam                                                  # camera for indyActor's button position
  103. thing    zoom1cam                                                # cam for first of highspeed tram shots
  104. thing    wideshotcam                                               # wide rolling shot
  105. thing    arrivalcam                                                # final tram movement shot
  106.  
  107. thing    end_campos                                                # cam1 will be placed here at the very end
  108. #.......................TRIGGERS....................
  109. surface    blastwall
  110. surface    cratespot                            mask=0x80
  111. sector    line1trigger
  112.  
  113.  
  114. #.......................MODELS......................
  115. model    wheelhand=hand_in_pulleywheel.3do                        local
  116.  
  117. #.......................ENEMIES....................
  118. thing    commie0
  119. thing    commie1
  120. thing    commie2
  121. thing    commie3
  122.  
  123. #.......................COGS....................
  124. cog        hintcog
  125. cog        waycog
  126.  
  127.  
  128. #.......................KEYFRAMES....................
  129. keyframe    in_fix=0in_place_pulleywheel.key                    local 
  130. keyframe    release=vol_release_arm.key                            local
  131. keyframe    in_switchhit=in_activate_medium.key                    local
  132. keyframe    switchrun=vol_release_arm.key                        local
  133.  
  134. #.......................SAYLINES....................
  135. sound    in_line1=VL07J01.WAV                                    local    # Volodnikov must have been here. Too bad...
  136. sound    in_line2=VL07J02.WAV                                    local    # This thing needs a replacement pulley.
  137. sound    in_line3=VL07J03.WAV                                    local    # Ok, ready to roll.
  138.  
  139. #.......................SOUND_FX....................
  140. sound    click=tem_monkeykey_unlock_c.wav                        local
  141. sound    snap=teo_crush_prime_c.wav                                local    
  142. sound    com_cue=mus_gen_russbold1.wav                            local    
  143. sound    spot_cue=mus_gen_russsubdued1.wav                        local    
  144. sound    tramcreak1=jep_sus_crk_1.WAV                            local
  145. sound    tramcreak2=jep_sus_crk_2.WAV                            local
  146. sound    releasesnd=gen_lever_reset.wav                            local
  147.  
  148. sound    commie_entry1=nub_aethdoorarm_stop_c.wav                local    # twice at low volume    
  149. sound    commie_entry2=nub_croc_stop_c.wav                        local    # once louder    
  150. sound    escape_cue=mus_jep_indyrescue2.wav                        local
  151.  
  152.  
  153.  
  154.  
  155. #.......................TEMPLATES....................
  156. template    thepart=trampivot                                    local
  157. template    dust=explosiondust                                    local
  158. template    shot=+dummy_bazooka                                    local
  159. template    ghostTpl=ghost                                        local
  160.  
  161.  
  162. #.......................VARIABLES....................
  163. int        inthezone=0                                                   local
  164. int        inthecar=0                                                   local
  165. int        inonthecrate=0                                               local
  166. int        fixed=0                                                       local
  167. int        attempted=0                                                   local
  168. int        cratecamtarg=0                                            local
  169. int        isrocking=0                                                local
  170. int        in_line                                                    local
  171. int        in_swapref                                                local         
  172. int        i                                                           local
  173. int        animId                                                       local
  174. int        curSound                                                   local
  175.  
  176. flex    pulsetime=1.75                                               
  177. flex    tempheadspeed                                            local                                               
  178. flex    escape                                                    local                                               
  179. flex    fixscene                                                local                                               
  180. flex    inboxprep                                                local                                               
  181. flex    playerrestore                                            local                                               
  182.  
  183. #.......................VECTORS....................
  184. vector    camPos                                                       local
  185. vector     lookVector                                                   local
  186. vector    indyActorTargPos                                        local
  187.  
  188. end
  189.  
  190. # ========================================================================================
  191. code
  192.  
  193. startup:
  194.     Sleep(.25);
  195.     
  196.     # get the player
  197.     player = GetLocalPlayerThing();
  198.     
  199.     # fix camera
  200.     ResetCameraFOV(0, 0);
  201.     
  202.     # disable indyActorActors' AI
  203.     AISetCutSceneMode(indyActor);
  204.  
  205.     # disable the commies at startup
  206.     for (i = 0; i <= 3; i = i + 1) 
  207.     {
  208.         SetThingFlags(commie0[i], 0x80000);
  209.         #AISetMode(commie0[i], 0x12040);        // Disable the AI, but make sure we still gat messages, and don't check for cliffs while moving.
  210.         AISetCutSceneMode(commie0[i]);
  211.     }
  212.  
  213.     # no collide for the switch
  214.     SetCollideType(switch, 0);
  215.     
  216.     return;
  217.  
  218. # ========================================================================================
  219. activated:
  220.  
  221.     
  222.     If (GetSenderRef() == fixtarget)    # player activates the trams' damaged mount    piece
  223.     {
  224.  
  225.             If (inthezone == 0) return;
  226.             If (inonthecrate == 0) return;
  227.             If (fixed == 0)    
  228.             {
  229.                 StartCutscene(1);
  230.                 
  231.                 If (GetCurItem(player) == 107)    # player has the pulley wheel in his hand
  232.                 {
  233.                     
  234.                     # disable the player
  235.                     MakeMeStop();
  236.                     
  237.                     # line up the actor
  238.                     DeselectWeaponWait(player); # stow any weapon or lighter
  239.                     # get actor in player's location
  240.                     CopyOrientAndPos(player, indyActor);
  241.                     CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  242.                     SetThingFlags(player, 0x80000);
  243.                     ClearThingFlags(indyActor, 0x80000);
  244.                     
  245.                     # play anims and sounds, replace part
  246.                     ChangeInv(player, 107, -1);
  247.                     call fixscene;
  248.                     #restore the player
  249.                     call playerrestore;
  250.                     return;
  251.                 }
  252.  
  253.                 
  254.             else
  255.                 {
  256.                 # prep the actor on the box
  257.                 call inboxprep;
  258.                 
  259.                 If (cratecamtarg == 0)
  260.                 {
  261.                 # create a target right above and in front of indyActor actor
  262.                 indyActorTargPos = VectorAdd(VectorTransformToOrient(indyActor, '0.0 0.02 0.02'), GetThingPos(indyActor));
  263.                 indyActortarget = CreateThingAtPos(ghostTpl, GetThingSector(indyActor), indyActorTargPos, '0 0 0');
  264.                 CaptureThing(indyActortarget);
  265.                 cratecamtarg = 1;
  266.                 }
  267.  
  268.                 # camera control
  269.                 ResetCameraFOV(0, 0);
  270.                 Sleep(0.01);
  271.                 curCam=GetCurrentCamera();
  272.                 SetExtCamOffsetToThing(fixfailcam);
  273.                 SetExtCamLookOffsetToThing(showCamtarg);
  274.                 #Sleep(1.0);
  275.                 #SetCameraSecondaryFocus(2, indyActortarget);
  276.                 #SetCameraFocus(2, fixfailcam);
  277.                 #SetCurrentCamera(2);
  278.                 #SetCameraLookInterp(2, 1);
  279.                 #SetCameraInterpSpeed(2, 1.0);
  280.                 #Sleep(0.01);
  281.                 #SetCameraSecondaryFocus(2, showCamtarg);
  282.                 SetCameraFOV(80, 1, 0.5);
  283.                 
  284.                 # play anim , "this thing needs..."
  285.                 AIEnableHeadTracking(indyActor, showCamtarg);
  286.                 #PlayMode(indyActor, 60, 0);
  287.                 PlayVoice(indyActor, in_line2, 1.0, 1);
  288.                 Sleep(0.5);
  289.                 ResetCameraFOV(0, 0);
  290.                 
  291.                 AIDisableHeadTracking(indyActor);
  292.                 SetCurrentCamera(curCam);
  293.                 #restore the player
  294.                 call playerrestore;
  295.                 }
  296.             }
  297.             
  298.             
  299.     }
  300.  
  301.     If (GetSenderRef() == switchhitplate)
  302.         {
  303.             If (inthecar != 1) return;
  304.             If (fixed == 1)
  305.             {
  306.             call escape;
  307.             }
  308.  
  309.             else If (fixed == 0)
  310.             {
  311.             # disable the player
  312.             StartCutscene(1);
  313.             SetActorFlags(player, 0x200000);
  314.             MakeMeStop();
  315.  
  316.             # line up the actor
  317.             DeselectWeaponWait(player); # stow any weapon or lighter
  318.             TeleportThing(indyActor, player);
  319.             CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  320.             SetThingFlags(player, 0x80000);
  321.             ClearThingFlags(indyActor, 0x80000);
  322.  
  323.             # offset camera to the fixCam position
  324.             SetExtCamOffsetToThing(butCam);
  325.             SetExtCamLookOffsetToThing(switchshottarg);
  326.             
  327.             # reset then set camera FOV
  328.             ResetCameraFOV(0, 0);
  329.             Sleep(0.01);
  330.             SetCameraFOV(60, 1, 1.0);
  331.  
  332.             Sleep(0.25); # wait a beat
  333.             
  334.             AISetLookThing(indyActor, switchshottarg);
  335.             Sleep(0.5);
  336.             PlayKey(indyActor, in_switchhit, 4, 0x12, 0);
  337.             Sleep(0.25);
  338.             PlayVoice(indyActor, in_line2, 1.0, 1);
  339.             Sleep(0.25);
  340.             TeleportThing(player, indyActor);
  341.             ClearActorFlags(player, 0x200000);
  342.             ClearThingFlags(player, 0x80000);
  343.             SetThingFlags(indyActor, 0x80000);
  344.             inthecar = 1;
  345.             ResetCameraFOV(0, 0);
  346.             RestoreExtCam();
  347.             EndCutscene();
  348.             ClearActorFlags(player, 0x200000);
  349.             
  350.             }
  351.         }
  352.  
  353. return;
  354.  
  355. # ========================================================================================
  356. # ========================================================================================
  357. fixscene:
  358.  
  359.     # scene cannot repeat
  360.     fixed = 1;
  361.     
  362.     # clear the hint
  363.     SendMessage(hintcog, user0);
  364.     
  365.     AttachThingToThing(pivotrack, funicular);
  366.     
  367.     # play anims on actor
  368.     PlayKey(indyActor, in_fix, 4, 0x12, 0);
  369.     Sleep(0.5);
  370.     # swap hand mesh
  371.     in_swapref=SetThingMesh(indyActor, 15, wheelhand, 0);
  372.     
  373.     # indyActor looks at the damaged piece
  374.     AIEnableHeadTracking(indyActor, pivotrack);
  375.  
  376.     # get camera to the fixCam position    on action cut
  377.     curCam=GetCurrentCamera();
  378.     SetCameraFocus(2, fixCam);
  379.     SetCameraSecondaryFocus(2, fixcamtarg);
  380.     SetCurrentCamera(2);
  381.     TeleportThing(indyActor, in_fixmv);
  382.     SetCameraFOV(48, 0, 0);
  383.  
  384.     Sleep(1.0);
  385.     PlaySoundLocal(click, 1.0, 0.0, 0x0, 0);
  386.     
  387.     Sleep(.75);
  388.     RestoreThingMesh(indyActor, in_swapref); # drop that wheel
  389.     PlaySoundLocal(snap, 0.75, 0.0, 0x0, 0);
  390.     # move funicular into place, create correct parts
  391.     DestroyThing(pivotrack);
  392.     thepiece=CreateThing(thepart, realpivotghost);
  393.     CaptureThing(thepiece);
  394.     
  395.     # lock them down
  396.     AttachThingToThingEx(thepiece, funicular, 0x000C);
  397.     Sleep(.5);
  398.  
  399.     
  400.     # "ok now i'm ready...'
  401.     PlayVoice(indyActor, in_line3, 1.0, 1);
  402.     #Sleep(.5);
  403.  
  404.     # commie penetration sounds
  405.     PlaySoundThing(commie_entry1, blastwalltarg, 0.75, 6, 30, 0x0);
  406.     Sleep(0.5);
  407.     PlaySoundThing(commie_entry1, blastwalltarg, 0.75, 6, 30, 0x0);
  408.     
  409.     # indyActor stops looking at the pivotrack
  410.     AIDisableHeadTracking(indyActor);
  411.     
  412.     # indy checks out the commotion
  413.     SetThingMaxRotVel(indyActor, 120.0);
  414.     AISetLookThing(indyActor, blastpos);
  415.     Sleep(0.75);
  416.  
  417.     # music plays
  418.     PlaySoundLocal(com_cue, 1.0, 0.0, 0x0, 0);
  419.     
  420.     # Camera pans/dollys to blastwall
  421.     #SetCameraInterpSpeed(2, 2.0);
  422.     #SetCameraLookInterp(2, 1);
  423.     #Sleep(0.01);
  424.     #SetCameraSecondaryFocus(2, lavacrosstarg);
  425.     
  426.     animId=MoveThingToPos(fixcamtarg, GetThingPos(blastwalltarg), 3.0);
  427.     #Sleep(2.0);
  428.     MoveToFrame(fixCam, 1, 3.5);
  429.     Sleep(3.0);
  430.     SetCameraLookInterp(2, 0);
  431.     WaitForStop(fixCam);
  432.     #Sleep(0.5);
  433.     #animId=MoveThingToPos(lavacrosstarg, GetThingPos(blastpos), 1.0);
  434.     
  435.     # last commie noise
  436.     PlaySoundThing(commie_entry2, blastpos, 1, 8, 40, 0x0);
  437.     #Sleep(0.5);
  438.     
  439.     #animId = MoveThingToPos(line3targ, GetThingPos(lavacrosstarg), 1.0);
  440.     #Sleep(2.0);
  441.     
  442.     # new camera looks from lavacross to blastwall
  443.     #SetCameraFocus(2, blastwallcam);
  444.     #SetCameraFOV(90, 1, 2);
  445.     #Sleep(2.0);
  446.  
  447.     # wall explodes, commies rush in
  448.     CreateThing(shot, blastpos);
  449.     # screenshake and dust
  450.     SetPulse(0.05);
  451.  
  452.     Sleep(0.5);
  453.  
  454.     # commies are drawn
  455.     for (i = 0; i <= 3; i = i + 1)
  456.         {
  457.         ClearThingFlags(commie0[i], 0x80000);
  458.         }
  459.  
  460.     SetAdjoinFlags(blastwall, 2);
  461.     SetAdjoinFlags(GetSurfaceAdjoin(blastwall), 2);
  462.     SetFaceGeoMode(blastwall, 0);
  463.  
  464.     Sleep(0.25);
  465.     # stop screenshake and dust
  466.     SetPulse(0.0);
  467.     
  468.     # commies rush in
  469.     for (i = 0; i <= 3; i = i + 1)
  470.         {
  471.         AISetMoveSpeed(commie0[i], 2.0);
  472.         AISetLookThing(commie0[i], commietarget);
  473.         AISetMoveThing(commie0[i], commietarget, 0);
  474.         Sleep(.01);
  475.         }
  476.  
  477.     Sleep(2.0);
  478.  
  479.     # put indyActor in endcutscene position
  480.     TeleportThing(indyActor, in_endscenemv);
  481.     # put the player at the actor's position, end the scene
  482.     TeleportThing(player, indyActor);
  483.     ClearThingFlags(player, 0x80000);
  484.     SetThingFlags(indyActor, 0x80000);
  485.     
  486.     # restore the game cam
  487.     SetCameraPosition(1, GetThingPos(endscenecam));
  488.     SetCurrentCamera(1);
  489.     ResetCameraFOV(0, 0);
  490.     
  491.     # restore player control
  492.     ClearActorFlags(player, 0x200000);
  493.     EndCutScene();
  494.     RestoreExtCam();
  495.  
  496.     # begin backup commie generation
  497.     SendMessage(waycog, user0);
  498.     
  499.  
  500. return;
  501.  
  502.  
  503. # ========================================================================================
  504. escape:
  505.  
  506.     # prep actor
  507.     SetActorFlags(player, 0x200000);
  508.     StartCutScene(1);
  509.     
  510.     # line up the actor
  511.     DeselectWeaponWait(player); # stow any weapon or lighter
  512.     CopyOrientAndPos(player, indyActor);
  513.     CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  514.     SetThingFlags(player, 0x80000);
  515.     ClearThingFlags(indyActor, 0x80000);
  516.     AISetLookThingEyeLevel(indyActor, switchshottarg);
  517.     
  518.     # goto take off camera
  519.     SetCameraSecondaryFocus(2, rollawaytarg);
  520.     SetCameraFocus(2, rollCam);
  521.     SetCurrentCamera(2);
  522.     SetCameraFOV(70, 0, 0);
  523.  
  524.     
  525.     # indy hits switch, tram rolls off
  526.     AIWaitForStop(indyActor);
  527.     Sleep(0.25);
  528.     PlayKey(indyActor, in_switchhit, 4, 0x12, 0);
  529.     Sleep(0.25);
  530.  
  531.     # animate the switch
  532.     PlayKey(switch, switchrun, 4, 0x12, 0);
  533.     PlaySoundLocal(releasesnd, 1, -1, 0x0, 0);
  534.     
  535.     Sleep(0.25);
  536.     PlaySoundLocal(commie_entry1, 1, 0, 0x0, 0);
  537.     
  538.     # Actor looks at temple target, funicular is away
  539.     SetThingMaxRotVel(indyActor, 250.0);
  540.     AISetLookThingEyeLevel(indyActor, templetarget);
  541.     AttachThingToThing(zoom2targ, funicular);
  542.     AIWaitForStop(indyActor);
  543.     #StopThing(indyActor);
  544.     AttachThingToThingEx(indyActor, funicular, 0x000C);
  545.     AttachThingToThingEx(indyInTram, funicular, 0x000C);
  546.     MoveToFrame(funicular, 1, 6);
  547.     Sleep(2.0);
  548.  
  549.     # show the in tram actor, hide the indyActor
  550.     SetThingFlags(indyActor, 0x80000);
  551.     ClearThingFlags(indyInTram, 0x80000);
  552.     CopyPlayerHolsters(player, indyInTram); # make sure actor has matching props
  553.     
  554.     # cut to first zoom shot
  555.     SetCameraSecondaryFocus(2, zoom1targ);
  556.     SetCameraFocus(2, zoom1cam);
  557.  
  558.     # commies blasting on edge
  559.     for (i = 0; i <= 3; i = i + 1)
  560.         {
  561.         If (commie0[i] != -1)
  562.             {
  563.             AISetMoveThing(commie0[i], lastfirepos0[i], 0);
  564.             Sleep(0.5);
  565.             AIEnableInstinct(commie0[i], "lookfortarget", 0);
  566.             }
  567.         }
  568.  
  569.     AISetFireTarget(commie0, endfire_target1);
  570.     AISetFireTarget(commie1, endfire_target2);
  571.     AISetFireTarget(commie2, endfire_target1);
  572.     AISetFireTarget(commie3, endfire_target2);
  573.     
  574.     SetCameraFOV(60, 0, 0);
  575.     Sleep(1.0);
  576.  
  577.     # play escape cue
  578.     PlaySoundLocal(escape_cue, 1.0, 0.0, 0x0, 0);
  579.     Sleep(2.0);
  580.  
  581.     # cut to long shot
  582.     SetCameraSecondaryFocus(2, zoom2targ);
  583.     SetCameraFocus(2, wideshotcam);
  584.     SetCameraFOV(100, 0, 0);
  585.     Sleep(2.0);
  586.     
  587.     # cut to last zoom
  588.     SetCameraSecondaryFocus(2, templetarget);
  589.     SetCameraFocus(2, arrivalcam);
  590.  
  591.     
  592. return;
  593.     
  594.     # finish is handled in the arrived handler
  595. # ========================================================================================
  596. entered:
  597.  
  598. If ((GetSenderRef() == line1trigger) &&  (attempted == 0))
  599.     {
  600.     
  601.     attempted = 1;    #line won't repeat
  602.  
  603.     curCam = GetCurrentCamera();
  604.     
  605.     StartCutScene(1);
  606.     # disable the player
  607.     SetCollideType(crate, 0);
  608.     MakeMeStop();
  609.  
  610.     # create a target right above and in front of indyActor actor and attach it to him
  611.     indyActorTargPos = VectorAdd(VectorTransformToOrient(player, '0.0 0.02 0.015'), GetThingPos(player));
  612.     indyActortarget = CreateThingAtPos(ghostTpl, GetThingSector(player), indyActorTargPos, '0 0 0');
  613.     CaptureThing(indyActortarget);
  614.     AttachThingToThing(indyActortarget, indyActor);
  615.  
  616.     
  617.     # cut camera out to showCam position
  618.     SetCameraSecondaryFocus(2, indyActortarget);
  619.     SetCameraFocus(2, showCam);
  620.     SetCurrentCamera(2);
  621.     SetCameraLookInterp(2, 0);
  622.     Sleep(0.01);
  623.     SetCameraFOV(70, 0, 0);
  624.  
  625.     # line up the actor
  626.     DeselectWeapon(player); # stow any weapon or lighter
  627.     CopyOrientAndPos(player, indyActor);
  628.     CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  629.     #Sleep(0.25); # wait a beat
  630.     SetThingFlags(player, 0x80000);
  631.     ClearThingFlags(indyActor, 0x80000);
  632.  
  633.     
  634.     # play the spot cue
  635.     PlaySoundLocal(spot_cue, 0.5, 1, 0x0, 0);
  636.     
  637.  
  638.     # Move indyActor over to the tram 
  639.     AISetLookThingEyeLevel(indyActor, in_mv0);
  640.     AIWaitForStop(indyActor);
  641.     
  642.     AISetMoveSpeed(indyActor, 1.0);
  643.     AISetMoveThing(indyActor, in_mv0, 0);
  644.     
  645.     # get player maxheadrotvel and slow down indy
  646.     tempheadspeed=GetThingMaxHeadVel(player);
  647.     SetThingMaxHeadVel(indyActor, 100.0);
  648.     
  649.     Sleep(0.5);
  650.     
  651.     # indyActor looks at the damaged piece
  652.     AIEnableHeadTracking(indyActor, pivotrack);
  653.     Sleep(0.75);
  654.     SetThingMaxRotVel(indyActor, 120.0);
  655.     AISetLookThingEyeLevel(indyActor, pivotrack);
  656.     AIWaitForStop(indyActor);
  657.     Sleep(0.25);
  658.     # say volodnikov line
  659.     in_line=PlayVoice(indyActor, in_line1, 1.0, 0);
  660.     #Sleep(2.0);
  661.     DetachThing(indyActortarget);
  662.     
  663.     # camera begins to zoom
  664.     SetCameraFOV(50, 1, 5.0);
  665.     
  666.     # move camera focus object up to pivotrack
  667.     animId = MoveThingToPos(indyActortarget, GetThingPos(showCamtarg), 5.0);
  668.     #Sleep(1.0);
  669.     MoveToFrame(showCam, 1, 0.84);
  670.     WaitForSound(in_line);
  671.     Sleep(1.0);
  672.  
  673.     # camera look interp is on
  674.     #SetCameraLookInterp(2, 1);
  675.     #SetCameraInterpSpeed(2, 5);
  676.     # camera pans to the pivotrack
  677.     #SetCameraSecondaryFocus(2, pivotrack);
  678.     
  679.     AIDisableHeadTracking(indyActor);
  680.     
  681.     # interp from behind at end
  682.     
  683.     
  684.     # restore the player at indyActorActor's position
  685.     CopyOrientAndPos(indyActor, player);
  686.     SetThingFlags(indyActor, 0x80000);
  687.     ClearThingFlags(player, 0x80000);
  688.     EndCutScene();
  689.     ClearActorFlags(player, 0x200000);
  690.     SetCollideType(crate, 3);
  691.     
  692.     # restore the camera
  693.     # camera interps back from this position
  694.     Sleep(0.01);
  695.     SetCameraPosition(1, GetThingPos(fixendcampos));
  696.     SetCurrentCamera(1);
  697.     ResetCameraFOV(0, 0);
  698.     RestoreExtCam();
  699.     Sleep(0.01);
  700.     ResetCameraFOV(0, 0);
  701.     DestroyThing(indyActortarget);
  702. }
  703.  
  704.  
  705. If ((GetSenderRef() == funicular) && (GetSourceRef() == player))
  706.     {
  707.     inthecar = 1;
  708.     }
  709.  
  710. If ((GetSenderRef() == cratespot) && (GetSourceRef() == crate))
  711.     {
  712.     inthezone = 1;
  713.     }
  714.  
  715. If ((GetSenderRef() == crate) && (GetSourceRef() == player))
  716.     {
  717.     inonthecrate = 1;
  718.     }
  719.     
  720. return;
  721.  
  722. # ========================================================================================
  723. exited:
  724.  
  725.  
  726. If ((GetSenderRef() == cratespot) && (GetSourceRef() == crate))
  727.     {
  728.     inthezone = 0;
  729.     }
  730.  
  731. If ((GetSenderRef() == funicular) && (GetSourceRef() == player))
  732.     {
  733.     inthecar = 0;
  734.     }
  735.  
  736. If ((GetSenderRef() == crate) && (GetSourceRef() == player))
  737.     {
  738.     inonthecrate = 0;
  739.     }
  740.     return;    
  741.  
  742.  
  743. # ========================================================================================
  744. aievent:
  745.     
  746.     If (GetSenderRef() == indyActor) return;
  747.     
  748.     if (GetParam(0) != 0x2000)            // We only care about the "goal near" AI event.
  749.         return;
  750.  
  751.     commie = GetSenderRef();
  752.     goalThing = AIGetGoalThing(commie);
  753.  
  754.     
  755.     
  756.     
  757.     if (goalThing == commietarget)
  758.     {
  759.         AISetLookThing(commie, commietarget2);
  760.         AISetMoveThing(commie, commietarget2, 0);
  761.         return;
  762.     }
  763.  
  764.     if (goalThing == commietarget2)
  765.     {
  766.         AISetLookThing(commie, commietarget3);
  767.         AISetMoveThing(commie, commietarget3, 0);
  768.         return;
  769.     }
  770.  
  771.     if (goalThing == commietarget3)
  772.     {
  773.         AISetLookThing(commie, commietarget4);
  774.         AISetMoveThing(commie, commietarget4, 0);
  775.         return;
  776.     }
  777.  
  778.     if (goalThing == commietarget4)
  779.     {
  780.         #AIClearMode(commie, 0x12040);                // Re-enable the AI and turn cliff-checking back on.
  781.         AIClearCutSceneMode(commie);
  782.         AISetLookThing(commie, indyActor);    
  783.         AISetFiretarget(commie, indyActor);
  784.         #AISetMode(commie, 0x202);                    // Set our mode to active and attacking.
  785.         
  786.         AISetMoveThing(commie, commietarget5, 0);    // And head towards our last target.
  787.         return;
  788.     }
  789.  
  790. return;
  791.     
  792. # ========================================================================================
  793. inboxprep:
  794.  
  795.     # disable the player
  796.     MakeMeStop();
  797.     
  798.     # line up the actor
  799.     DeselectWeapon(player); # stow any weapon or lighter
  800.     CopyOrientAndPos(player, indyActor);
  801.     CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  802.     Sleep(0.25); # wait a beat
  803.     SetThingFlags(player, 0x80000);
  804.     ClearThingFlags(indyActor, 0x80000);
  805.     #AISetLookThingEyeLevel(indyActor, in_fixmv);
  806.     AISetMoveSpeed(indyActor, 1.0);
  807.     AISetMoveThing(indyActor, in_fixmv, 1);
  808.     AISetLookThing(indyActor, pivotrack);
  809.     AIWaitForStop(indyActor);
  810.  
  811. return;
  812.  
  813. # ========================================================================================
  814. playerrestore:
  815.  
  816.     CopyOrientAndPos(indyActor, player);
  817.     SetThingFlags(indyActor, 0x80000);
  818.     ClearThingFlags(player, 0x80000);
  819.     ResetCameraFOV(0, 0);
  820.     SetCameraLookInterp(2, 0);
  821.     Sleep(0.01);
  822.     SetCurrentCamera(curCam);
  823.     RestoreExtCam();
  824.     EndCutScene();
  825.     ClearActorFlags(player, 0x200000);
  826.  
  827. return;
  828.  
  829. # ========================================================================================
  830. pulse:
  831.  
  832.         SetPOVShake('0.0 0.0 0.03', '0.0 0.0 0.00', 80.0, 0.80);
  833.         CreateThing(dust, blastpos);
  834. return;
  835.  
  836. # ========================================================================================
  837. arrived:
  838.  
  839.     If (GetSenderRef() != funicular) return;
  840.     If (isrocking != 0) return;
  841.     {
  842.         isrocking=1;
  843.         PlaySoundThing(commie_entry2, funicular, 1, 3, 20, 0x0);
  844.         StopSound(curSound, 0.0);
  845.     }
  846.     
  847.     # rocking animations play here
  848.     Rotate(funicular, -5, 0, 0.5);
  849.     PlaySoundLocal(tramcreak1, 1, 1, 0x0, 0); 
  850.     Sleep(0.5);
  851.     Rotate(funicular, 10, 0, 0.5);
  852.     Sleep(0.5);
  853.     Rotate(funicular, -5, 0, 0.5);
  854.     PlaySoundLocal(tramcreak2, 1, -1, 0x0, 0); 
  855.     Sleep(0.5);
  856.     
  857.     # hide the tram actor, show indyactor
  858.     SetThingFlags(indyInTram, 0x80000);
  859.     ClearThingFlags(indyActor, 0x80000);
  860.     
  861.     # indy looks at the gate
  862.     
  863.     SetThingMaxRotVel(indyActor, 150.0);
  864.     AISetLookThing(indyActor, in_endlook);
  865.     
  866.     Sleep(1.0);
  867.     SetCameraPosition(1, GetThingPos(end_campos)); # prep follow-cam to swing behind indy
  868.     call playerrestore;
  869.  
  870. return;
  871.  
  872. # ========================================================================================
  873. # ========================================================================================
  874. # ========================================================================================
  875.  
  876. end
  877.  
  878.  
  879.  
  880.  
  881.